package com.caiyouxi.pay.payment.weixin.wxpay;

public class Example
{
    public static void main(String args[])
    {
        try
        {
            WxPayHelper wxPayHelper = new WxPayHelper();
            //先设置基本信息
            wxPayHelper.SetAppId("wx87c069f23574919d");
            wxPayHelper.SetAppKey("INiiwer85UixhX350A55p3dG531Eb1jrOHc2syY2x5uzVLnCjjERMFlqv5N8zkcmYrea0JLT9Uriy1dEeL9KyEDJDHV6ovNQKSZPvihqvUZ2fOcpkCR7RFmWpcp5ZxxS");
            wxPayHelper.SetPartnerKey("fe670607e37c9cc725ef2ed76b9237bd");
            wxPayHelper.SetSignType("sha1");
            //设置请求package信息
            wxPayHelper.SetParameter("bank_type", "WX");
            wxPayHelper.SetParameter("body", "test");
            wxPayHelper.SetParameter("partner", "1218456501");
            wxPayHelper.SetParameter("out_trade_no", CommonUtil.CreateNoncestr());
            wxPayHelper.SetParameter("total_fee", "0.02");
            wxPayHelper.SetParameter("fee_type", "1");
            wxPayHelper.SetParameter("notify_url", "http://www.vyuns.com/Order_notifyPay.action");
            wxPayHelper.SetParameter("spbill_create_ip", "127.0.0.1");
            wxPayHelper.SetParameter("input_charset", "GBK");

            System.out.println("生成app支付package:");
            System.out.println(wxPayHelper.CreateAppPackage("test"));

            System.out.println("生成jsapi支付package:");
            System.out.println(wxPayHelper.CreateBizPackage());

            System.out.println("生成原生支付url:");
            System.out.println(wxPayHelper.CreateNativeUrl("bcd"));
            System.out.println("生成原生支付package:");
            System.out.println(wxPayHelper.CreateNativePackage("0", "ok"));

        }
        catch (Exception e)
        {
            System.out.println(e.getMessage());
        }

    }

}
